<include file="Public/min-header"/>
<link href="__PUBLIC__/plugins/daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css" />
<script src="__PUBLIC__/plugins/daterangepicker/moment.min.js" type="text/javascript"></script>
<script src="__PUBLIC__/plugins/daterangepicker/daterangepicker.js" type="text/javascript"></script>
<div class="wrapper">
  <include file="Public/breadcrumb"/>
  <style type="text/css">
  	.table input{display: none;}
  </style>
  <section class="content"> 
    <div class="container-fluid">
      <div class="panel panel-default">
        <div class="panel-heading"> 
          <h3 class="panel-title"><i class="fa fa-list"></i>PDA入库明细</h3>
        </div>
        <div class="panel-body">    
		<div class="navbar navbar-default">                    
                <form id="search-form2" class="navbar-form form-inline"  method="get" action="{:U('ruku_pda')}">
                <div class="form-group">
				  
                  <div class="input-group">
                    <input type="text" class="form-control" id="order_sn" placeholder="订单号" value="{$Think.request.order_sn}" name="order_sn" />
                  </div>
                  <div class="input-group">
                    <input type="text" class="form-control" id="kehu" placeholder="客户/商户名" value="{$Think.request.kehu}" name="kehu"  style="width:120px;"/>
                  </div>
                  <div class="input-group">
                    <input type="text" class="form-control" id="biaoshi" placeholder="线路" value="{$Think.request.biaoshi}" name="biaoshi" style="width: 90px;"/>
                  </div>
                   <div class="input-group margin" style="width: 280px;">
                      <input type="text" id="start_time" value="{$timegap}" autocomplete="off" name="timegap" class="form-control pull-right">
                  </div>                  
                </div>
                <div class="form-group">    
                    <button class="btn btn-primary" id="button-filter search-order" type="submit"><i class="fa fa-search"></i> 筛选</button>    
                </div>
				<div class="form-group">    
                    <button type="button" class="btn btn-default pull-right" id="daochu"><i class="fa fa-file-excel-o"></i>&nbsp;导出excel</button>  
                </div>                                 
                </form>    
          </div>
                        
          <div id="ajax_return"> 
                 
                    <div class="table-responsive">
                        <table class="table table-bordered table-hover">
                            <thead>
                            <tr>
								<th class="sorting text-center">商家名</th>
                                <th class="sorting text-center">订单号</th>
                                <th class="sorting text-center">客户</th>
								<th class="sorting text-center">线路</th>
								<th class="sorting text-center">总件数</th>
                                <th class="sorting text-center">入库数</th>
								<th class="sorting text-center">入库时间</th>
								<th class="sorting text-center">金额</th>
								<th class="sorting text-center">退款</th> 
                            </tr>
                            </thead>
                            <tbody>

                            <volist name="list" id="v">
                                <tr>
                                    <td class="text-center">
                                            {$v.store_name}
                                    </td>
									<td class="text-center">
										<a href="javascript:" id="chakan" rel="{$v.order_id}">
										{$v.order_sn}
										</a></td>
                                    <td class="text-center">
                                             {$v.consignee}
                                    </td>
									<td class="text-center">
                                             {$v.biaoshi_xian}
                                    </td>
									<td class="text-center" style="font-size:16px;">{$v.jian_count}</td>
                                    <td class="text-center" style="font-size: 16px;color: green;"><?php echo $v[$z.'rukunum']; ?></td>
									</td>
									<td class="text-center"><span style="color:#f39c12;"><?php echo date('Y-m-d H:i:s',$v['ruku_last_time']); ?></span></td>
									<td class="text-center"><b style="color: red;">{:sanwei($v['order_amount']-$v['points_count'])}</b></td>
									<td class="text-center"><b style="color: red;">{$v.tuikuan}</b></td>
                                </tr>
                            </volist>
                            </tbody>
							<tbody>
								<tr style="font-size: 16px;color: red;">
									<td colspan="7" align="right">合计：</td>
									<td align="center">{$dprice}</td>
									<td align="center"></td>
								</tr>
							</tbody>
                        </table>
                    </div>
                
                <div class="row">
                    <div class="col-sm-6 text-left"></div>
                    <div class="col-sm-6 text-right">{$show}</div>
                </div>
          </div>
        </div>
      </div>
    </div>
    <!-- /.row --> 
  </section>
  <!-- /.content --> 
</div>
<!-- /.content-wrapper --> 
 <script>
 // 删除操作
function del(id)
{
	if(!confirm('确定要删除吗?'))
		return false;		
		$.ajax({
			url:"/index.php?m=Admin&c=Finance&a=delStoreWithdrawals&id="+id,
			success: function(v){	
                            var v =  eval('('+v+')');                                 
                            if(v.hasOwnProperty('status') && (v.status == 1))
                               location.href='{:U('Admin/Finance/store_withdrawals')}';
                            else                                
			        layer.msg(v.msg, {icon: 2,time: 1000}); //alert(v.msg);
			}
		}); 
	 return false;
}
 
$(document).ready(function() {
		$('#start_time').daterangepicker({
			format:"YYYY-MM-DD HH:mm",
			singleDatePicker: false,
			showDropdowns: true,
			minDate:'2020-01-01 00:00',
			maxDate:'2030-01-01 00:00',
			startDate:'{:date("Y-m-d")} 00:00',
	        showWeekNumbers: true,
	        timePicker: true,
	        timePickerIncrement: 1,
	        timePicker12Hour: false,
	        opens: 'left',
	        buttonClasses: ['btn btn-default'],
	        applyClass: 'btn-small btn-primary',
	        cancelClass: 'btn-small',
		    locale : {
	            applyLabel : '确定',
	            cancelLabel : '取消',
	            fromLabel : '起始时间',
	            toLabel : '结束时间',
	            customRangeLabel : '自定义',
	            daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
	            monthNames : [ '一月', '二月', '三月', '四月', '五月', '六月','七月', '八月', '九月', '十月', '十一月', '十二月' ],
	            firstDay : 1
	        }
		});
		
	$("#daochu").click(function(){
		var order_sn=$("#order_sn").val();
		var kehu=$("#kehu").val();
		var biaoshi=$("#biaoshi").val();
		var start_time=$("#start_time").val();
		location.href="/index.php/Admin/Finance/export_ruku?order_sn="+order_sn+"&kehu="+kehu+"&timegap="+start_time+'&biaoshi='+biaoshi;
	})

$(".table-responsive #chakan").click(function(){
		var myrel=$(this).attr('rel');
		var myrul='/index.php/Admin/order/detail/order_id/'+myrel;//+myrel;
			layer.open({
			  type: 2,
			  title:'订单信息',
			  shadeClose: true, //点击遮罩关闭
			  skin: 'layui-layer-rim', //加上边框
			  area: ['920px', '620px'], //宽高
			  content: myrul
		})
    });
});
</script>
</body>
</html>